#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(int argc, const char * argv[])
{  	 	     	   

    unsigned long n;
    int lucknum;
    do
    {  	 	     	   
        scanf("%d,%lu", &lucknum, &n);                                  //1
    }
    while (n < 8 || n > pow(2, 20) || lucknum < 2 || lucknum > 100);    //1

    int result = 0;
    while (n != 0)                                                      //1
    {  	 	     	   
        if (n % lucknum == 0)                                           //2
        {  	 	     	   
            result++;                                                   //1
            n /= lucknum;                                               //1
        }
        else
            break;                                                      //1
    }
    printf("count=%d\n", result);                                       //1
    return 0;                                                           //1
}